package com.javaex.book.pojo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单
 *
 * @author 黄星琦
 * @Date 2022年2月28日
 */
/**
 *
 * @author 黄星琦
 * @Date 2022年3月1日
 */
public class Order {

	/** 订单id */
	private String id;
	
	/** 下单时间 */
	private Date createTime;
	
	/** 订单状态：0未发货，1已发货，2已签收 */
	private Integer status;
	
	/** 下单用户的id */
	private Integer userId;
	
	/** 订单总金额 */
	private BigDecimal totalPrice;
	
	/** 当前订单所包含的订单项 */
	private List<OrderItem> items;
	
	public Order() {
	}

	public Order(String id, Integer userId, BigDecimal totalPrice) {
		this.id = id;
		this.userId = userId;
		this.totalPrice = totalPrice;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	
	public BigDecimal getTotalPrice() {
		return totalPrice;
	}
	
	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}
	
	public List<OrderItem> getItems() {
		return items;
	}
	
	public void setItems(List<OrderItem> items) {
		this.items = items;
	}

	@Override
	public String toString() {
		return "Order [id=" + id + ", createTime=" + createTime + ", status=" + status + ", userId=" + userId + "]";
	}
}
